package com.zd.bms.bean.vo.resp;

import com.zd.common.bean.model.TicketOrder;
import com.zd.common.common.enums.BmsUserTypeEnum;
import com.zd.common.common.enums.PayStatusEnum;
import com.zd.common.common.enums.TicketChannelEnum;
import com.zd.common.common.utils.DateTimeUtil;

public class TicketOrderRespVo extends TicketOrder {
	private String ticketName;
	private String purchaseType;
	private String payTimeStr;
	private String statuStr;

	public String getTicketName() {
		return ticketName;
	}

	public void setTicketName(String ticketName) {
		this.ticketName = ticketName;
	}

	public String getPurchaseType() {
		if(this.getChannel() == TicketChannelEnum.Automatic_Ticket.getKey()){
			this.purchaseType =  TicketChannelEnum.Automatic_Ticket.getValue();
		}
		if(this.getChannel() == TicketChannelEnum.Platform_user.getKey()){
			this.purchaseType =  TicketChannelEnum.Platform_user.getValue();
		}
		if(this.getChannel() == TicketChannelEnum.Scenic_spot_conductor.getKey()){
			this.purchaseType =  TicketChannelEnum.Scenic_spot_conductor
					.getValue();
		}
		return purchaseType;
	}

	public String getPayTimeStr() throws Exception {
		if(this.getStatus() == PayStatusEnum.Payment_success.getKey()){
			if( this.getPayTime() == null){
				this.payTimeStr = "";
			}else {
				this.payTimeStr = DateTimeUtil.date2String(this.getPayTime());
			}
		}else {
			this.payTimeStr = "未支付";
		}
		return payTimeStr;
	}

	public String getStatuStr() {
		if(this.getStatus() == PayStatusEnum.Payment_success.getKey()){
			this.statuStr = PayStatusEnum.Payment_success.getValue();
		}
		if(this.getStatus() == PayStatusEnum.To_be_paid.getKey()){
			this.statuStr = PayStatusEnum.To_be_paid.getValue();
		}
		return statuStr;
	}

}
